package com.easy.system.service.impl;

import java.io.File;
import java.util.LinkedList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.easy.auth.domain.Report;
import com.easy.base.service.impl.EManagerImpl;
import com.easy.common.jdbc.PageInfo;
import com.easy.common.util.Parameter;
import com.easy.common.web.PagedList;
import com.easy.system.domain.Lov;
import com.easy.system.service.LovService;

@Service
public class LovServiceImpl extends EManagerImpl<Lov> implements LovService {

	@Override
	public PagedList<Lov> findLovsList(PageInfo pageInfo) {
		return super.findAllEqual(new Lov(), pageInfo);
	}

	@Override
	public int saveLov(Lov lov) {
		String oid = lov.getOid();
		if (oid == null || "".equals(oid)) {
			return super.save(lov);
		}
		return super.edit(lov);
	}

	@Override
	public int removeLov(Lov lov) {
		return super.remove(lov);
	}

	@Override
	public List<Lov> findDictItems(Lov lov) {
		List<Lov> listLov = super.findList(lov);
		return listLov;
	}
	
	
	
	@Override
	public List<Lov> findAllLovList() {
		List<Lov> listLov = super.findList(new Lov()); 
		//List<Lov> listLov = super.findAllListNoParam(new Lov());
		return listLov;
	}
	public void findAllLovListToCase(){
		Parameter.LOVLIST= findAllLovList();
	}
	
	public Lov getLovByDictType(String dictType) {
		Lov o = new Lov();
		o.setDictType(dictType);
		Lov Lov = super.find(o);
		return Lov;
	}
	@Override
	public List<Lov> getLovBysubType(String subType) {
		Lov o = new Lov();
		o.setSubType(subType);
		List<Lov> Lov = super.findList(o);
		return Lov;
	}
	
	
	
}
